{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--BOOK_INFORMATION-->\n",
    "<img align=\"left\" style=\"padding-right:10px;\" src=\"figures/PHydro-cover-small.png\">\n",
    "*This is the Jupyter notebook version of the [Python in Hydrology](http://www.greenteapress.com/pythonhydro/pythonhydro.html) by Sat Kumar Tomer.*\n",
    "*Source code is available at [code.google.com](https://code.google.com/archive/p/python-in-hydrology/source).*\n",
    "\n",
    "*The book is available under the [GNU Free Documentation License](http://www.gnu.org/copyleft/fdl.html). If you have comments, corrections or suggestions, please send email to satkumartomer@gmail.com.*"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<!--NAVIGATION-->\n",
    "< [Functions](02.07-Functions.ipynb) | [Contents](Index.ipynb) | [3. Array](03.00-Array.ipynb) >"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 2.8 绘图\n",
    "\n",
    "在Python中提供了各种有绘图能力的库。我喜欢`Matplotlib`库，通过以下方式安装：\n",
    "\n",
    "```\n",
    "$ sudo pip install matplotlib\n",
    "```\n",
    "\n",
    "让我们绘制第一张y与x的关系曲线图。x包含了0到2π之间50等分的值，$y=sin(x)$。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAZQAAAEKCAYAAAA1qaOTAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3Xd8VFX+//HXJ42EAAkJIRAChJIEQocIoqJ0AVHEVRZ2\n7bqsu6KI7FpWXV1dXb66dl0VEMvaCyqrFAELgiIkSAk9hJbQQkkhhWSS8/sjg7+IQNokZ8rn+XjM\nIzP3njvzvpR85txyjhhjUEopperKz3YApZRS3kELilJKKZfQgqKUUsoltKAopZRyCS0oSimlXEIL\nilJKKZfQgqKUUsoltKAopZRyCS0oSimlX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YCCEivGa/mU5klK1ogVFKcucQ2msBoqB84wxZZYjKVUreshL\nKfsigSZAUyp6Kkp5JO2hKGWZiMyjYlj4DlRMdTzFciSlakVHG1bKIhG5Fig1xrzjHI34exEZaoz5\nynY2pWpKeyhKKaVcQs+hKKWUcgktKEoppVxCC4pSSimX0IKilFLKJbSgKKWUcgktKEoppVxCC4pS\nSimX0IKilFLKJf4fXFt4db5DidQAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0xd688b3e080>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "# 导入依赖库\n",
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "# 生成x从0到2π等分为50份的区间范围\n",
    "x = np.linspace(0,2*np.pi,50)\n",
    "y = np.sin(x) #计算sin(x)\n",
    "plt.plot(x,y)\n",
    "plt.xlabel('x')\n",
    "plt.ylabel('y')\n",
    "plt.legend(['sin(x)'])\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "`plt`是给定的缩写名称，它是指`matplot.pyplot`库。该库中所有的函数在需要时，应该使用`plt.`来调用。`plot`绘制连续的线型图，`xlabel`表示x轴的标签，`ylabel`表示y轴的标签。`legend`在图标中显示图例，`show()`用于显示图表，可以使用`savefig`保存图形，可以使用`close()`关闭图形。如上图展示了y与x的关系曲线。函数`np.linspace`用于生成0到2π范围内具有50等份的向量。关于生成这种向量的更多内容在下一章给出。"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.0"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
